﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Data.SqlClient;
using FangDuShi_API.DBUtility;
using System.Data;

namespace FangDuShi_API.DAL
{
    /// <summary>
    /// 经纪人操作日志 数据类
    /// </summary>
    public class RealtorLog
    {
        public RealtorLog()
        {

        }
        /// <summary>
        /// 增加一条数据
        /// </summary>
        public void Add(FangDuShi_API.Model.RealtorLog model)
        {
            StringBuilder strSql = new StringBuilder();
            strSql.Append("insert into t_RealtorLog(");
            strSql.Append("FRealtorID,FMobile,FRealName,FDistrictNo,FAgencyBranchID,FURL,FIP,FDate,FContent)");
            strSql.Append(" values (");
            strSql.Append("@FRealtorID,@FMobile,@FRealName,@FDistrictNo,@FAgencyBranchID,@FURL,@FIP,@FDate,@FContent)");
          
            SqlParameter[] parameters = {
					new SqlParameter("@FRealtorID", SqlDbType.Decimal,13),
					new SqlParameter("@FMobile", SqlDbType.NVarChar,40),
					new SqlParameter("@FRealName", SqlDbType.NVarChar,40),
					new SqlParameter("@FDistrictNo", SqlDbType.NVarChar,10),
					new SqlParameter("@FAgencyBranchID", SqlDbType.Decimal,13),
					new SqlParameter("@FURL", SqlDbType.NVarChar,255),
					new SqlParameter("@FIP", SqlDbType.NVarChar,15),
					new SqlParameter("@FDate", SqlDbType.DateTime),
					new SqlParameter("@FContent", SqlDbType.NVarChar,255)};
            parameters[0].Value = model.FRealtorID;
            parameters[1].Value = model.FMobile;
            parameters[2].Value = model.FRealName;
            parameters[3].Value = model.FDistrictNo;
            parameters[4].Value = model.FAgencyBranchID;
            parameters[5].Value = model.FURL;
            parameters[6].Value = model.FIP;
            parameters[7].Value = model.FDate;
            parameters[8].Value = model.FContent;

            DbHelperSQL.GetSingle(strSql.ToString(), parameters);
        }
    }
}
